{% trans_default_domain 'templatesTranslations' %}

<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="form-horizontal fos_user_registration_register" role="form">
    <div class="block-content">
        <fieldset>
            <legend>{{ 'register.title'|trans }}</legend>
            {% if not form.vars.valid %}
            <div class="alert alert-block alert-danger fade in">
                {% if form_errors(form.username) is not null %}
                    {{ form_errors(form.username) }}
                {% endif %}
                {% if form_errors(form.firstname) is not null %}
                    {{ form_errors(form.firstname) }}
                {% endif %}
                {% if form_errors(form.lastname) is not null %}
                    {{ form_errors(form.lastname) }}
                {% endif %}
                {% if form_errors(form.phone) is not null %}
                    {{ form_errors(form.phone) }}
                {% endif %}
                {% if form_errors(form.email) is not null %}
                    {{ form_errors(form.email) }}
                {% endif %}
                {% if form_errors(form.plainPassword.first) is not null %}
                    {{ form_errors(form.plainPassword.first) }}
                {% endif %}
                {% if form_errors(form.plainPassword.second) is not null %}
                    {{ form_errors(form.plainPassword.second) }}
                {% endif %}

            </div>
            {% endif %}
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.username) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.username, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.firstname) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.firstname, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.lastname) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.lastname, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.phone) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.phone, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.email) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.email, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.plainPassword.first) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.plainPassword.first, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-5 col-sm-5 col-md-5">{{ form_label(form.plainPassword.second) }}</label>
                <div class="col-xs-3 col-sm-3 col-md-3">
                    {{ form_widget(form.plainPassword.second, { 'attr': {'class': 'form-control'} }) }}
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-5 col-sm-5 col-md-5"></div>
                <div class="col-xs-3 col-sm-3 col-md-3">
                        <input class="btn btn-primary" type="submit" value="{{ 'register.button.submit'|trans }}" />
                        <a href="{{ path('frontend_frontoffice_homepage') }}" class="btn btn-default"> {{ 'common.go_back'|trans }} </a>
                </div>
            </div>
            {{ form_row(form._token) }}
        </fieldset>
    </div>
</form>
